package router

import (
	"github.com/gin-gonic/gin"
	. "goweb/handler"
)

func InitRouter() {
	router := gin.Default()
	orderGroup := router.Group("/order")

	{
		orderGroup.POST("/upload", UploadHandler)
		orderGroup.GET("/getAll", FindOrdersHandler)
		orderGroup.GET("/query/:userName", FindOrderByLikeUserName)
		orderGroup.GET("/queryByOrder", FindOrderOrderByCreatedAtAndAmountHandler)
		orderGroup.GET("/download", DownloadHandler)
		orderGroup.POST("/add", AddOrderHandler)
		orderGroup.POST("/update", UpdateOrderHandler)
		orderGroup.GET("/xlsx/download", XLSXDownloadHandler)
	}

	router.Run(":8080")
}
